﻿
namespace WXWorkSvc.Common.Data;
[EntityTypeConfiguration(typeof(TPrivateUserConfig))]
public class TPrivateUser
{
    public int AgentId { get; set; }
    [StringLength(64)]
    [Display(Name = "用户名")]
    public string UserId { get; set; } = default!;
    [Display(Name = "姓名")]
    public string UserName { get; set; } = default!;
    [Display(Name = "角色")]
    public int Roles { get; set; }
    [Display(Name = "角色")]
    [NotMapped]
    public string? RoleNames { get; set; }
    [Display(Name = "扩展")]
    public string? Ext { get; set; }
}

public class TPrivateUserConfig : IEntityTypeConfiguration<TPrivateUser>
{
    public void Configure(EntityTypeBuilder<TPrivateUser> builder)
    {
        builder.HasKey(t => new { t.AgentId, t.UserId });
    }
}
